package com.itheima.io2.serializable;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author Anomaly
 * @date 2023/2/9 23:25
 */
public class ObjectOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        Student admin = new Student("admin", 22);
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("file-io/src/stu.txt"));
        oos.writeObject(admin);
        oos.close();
    }
}
